<script setup lang="ts">
import { darkTheme, lightTheme } from 'naive-ui'
import { useThemeStore } from '@/stores/themes'
import { computed } from 'vue'

const myTheme = useThemeStore()
const defineTheme = computed(() => {
  return myTheme.theme === 'light' ? lightTheme : darkTheme
})
</script>

<template>
  <n-config-provider :theme="defineTheme">
    <n-message-provider>
      <n-dialog-provider>
        <main>
          <router-view v-slot="{ Component }">
            <keep-alive exclude="ReaderView">
              <component :is="Component" />
            </keep-alive>
          </router-view></main
      ></n-dialog-provider>
    </n-message-provider>
  </n-config-provider>
</template>
